package com.springMVC.service.impl;

import com.springMVC.dao.UserDao;
import com.springMVC.model.User;
import com.springMVC.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 * Created by aaa on 2015-07-23.
 */
@Service
public class UserServiceImpl implements UserService{
    @Autowired
    private UserDao userDao;

    /**
     * 检查用户名和密码是否匹配
     * @param username
     * @param password
     * @return
     */
    @Override
    public User checkNamePwd(String username, String password){
        return userDao.checkNamePwd(username, password);
    }

    /**
     * 检查用户名是否存在
     * @param username
     * @return
     */
    @Override
    public User checkNameExist(String username){
        return userDao.checkNameExist(username);
    }

    /**
     * 获取用户列表
     * @return
     */
    @Override
    public List<User> getList(){
        return userDao.getList();
    }
}
